package com.rogue.blog.service.article;

import com.rogue.blog.model.dto.article.ArticleCategoryDTO;
import com.rogue.blog.model.po.PageBean;
import com.rogue.blog.model.po.PageCondition;
import com.rogue.blog.model.vo.article.ArticleCategoryVO;

/**
 * Created by 86101 on 2018-10-09.
 */
public interface ArticleCategoryService {
    /**
     * 添加记录，返回主键
     *
     * @param dto
     * @return
     */
    long insert(ArticleCategoryDTO dto);

    /**
     * 根据id删除记录
     *
     * @param id
     * @param hardDelete
     * @return
     */
    int deleteById(long id, boolean hardDelete);

    /**
     * 根据id更新记录
     * @param id
     * @param dto
     * @return
     */
    int updateById(long id, ArticleCategoryDTO dto);

    /**
     * 根据id查询记录
     *
     * @param id
     * @return
     */
    ArticleCategoryVO selectById(long id);

    /**
     * 分页查询记录
     *
     * @param pageCondition
     * @return
     */
    PageBean<ArticleCategoryVO> selectByPage(PageCondition pageCondition);

    /**
     * 分类是否存在
     *
     * @param categoryName
     * @return
     */
    boolean exists(String categoryName);
}
